/*
 *      entity.h
 *      
 *      2009 Víctor Manuel Ochoa <kanito8a@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */


#ifndef ENTITY_H
#define ENTITY_H

#include "vector3.h"
#include "vector2.h"
#include "physics.h"

class Entity: public Physics
{		
	private:
		//~ float m_position[3];	// Position Vector
		//~ float m_rotation[3];	// Rotation Vector
		float m_scale[3];		// Scale Vector	
		float m_color[3];		// Entity color
		bool m_alive;
		
		
		//~ Vector2 m_pos;
		float m_z;
		
		float m_flipped;
		//~ Vector3 m_positionV;
		//~ Vector3 m_rotationV;
		//~ Vector3 m_scaleV;
		
	public:

		Entity();
		virtual ~Entity();
		virtual void draw()=0;
		virtual void update()=0;
		virtual void freeMemory()=0;		
		bool init();
		bool init(float _x,float _y,float _z,float _rot,float _scalex,float _scaley,float _scalez);
		//~ bool init(float _position[3],float _rotation[3],float _scale[3]);
				
		/*
		 * Inline set Functions
		 * */
		inline void flip(){m_flipped*=-1.0f;}
		inline void setZ(float _z){m_z=_z;}
		inline void setScale(float _scale[3]){for(int i=0;i<3;i++)m_scale[i]=_scale[i];}
		inline void setScale(float _scale){for(int i=0;i<3;i++)m_scale[i]=_scale;}
		inline void setColor(float _color[3]){for(int i=0;i<3;i++)m_color[i]=_color[i];}
		inline void setColor(float R,float G,float B){m_color[0]=R;m_color[1]=G;m_color[2]=B;}
		inline void setAlive(bool _value){m_alive=_value;}
		
		/*
		 * Inline get Functions
		 * */
		inline bool isFlipped(){return m_flipped==-1.0f;}
		inline float getFlippedValue(){return m_flipped;}
		inline float getZ(){return m_z;}		
		inline float* getScale(){return m_scale;}
		inline float getScaleX(){return m_scale[0];}
		inline float getScaleY(){return m_scale[1];}
		inline float getScaleZ(){return m_scale[2];}
		inline float* getColor(){return m_color;}
		inline float getColorR(){return m_color[0];}
		inline float getColorG(){return m_color[1];}
		inline float getColorB(){return m_color[2];}
		inline bool isAlive(){return m_alive;}		
};

#endif /* ENTITY_H */ 
